<template>
  <div>
    <div class="header-container">
      <h1>我的评价</h1>
      <div class="tab-container">
        <div
          v-for="(tab, index) in tabs"
          :key="index"
          class="tab-item"
          :class="{ active: currentIndex === index }"
          @click="handleClick(index)"
        >
          {{ tab }}
        </div>
      </div>
    </div>
    <div class="middle-container" />
    <div class="main-container">
      <div class="rate-item">
        <div class="rate-content">
          OMG,太好看了，太好用了，我的天阿！OMG,太好看了，太好用了，我的天阿！OMG,太好看了，太好用了，我的天阿！
        </div>
        <!-- 布尔值控制显示和隐藏 -->
        <div class="rate-with-img">
          <img src="../../assets/images/steel.png" alt="">
          <img src="../../assets/images/steel.png" alt="">
          <img src="../../assets/images/steel.png" alt="">
        </div>

        <div class="time">2019-06-20</div>
        <div class="goods-detail">
          <img src="../../assets/images/steel.png" alt="">
          <div class="goods-info">
            <div class="goods-name">钢管</div>
            <div class="goods-mark">
              <div class="mark-info">
                <span>标 号：</span>外16内6.03<span />
              </div>
              <div class="mark-info">
                <span>标 号：</span>外18内6.03<span />
              </div>
              <div class="mark-info">
                <span>标 号：</span>外20内6.03<span />
              </div>
            </div>
            <div class="goods-price">299.00元/吨</div>
          </div>
        </div>
      </div>
      <div class="rate-item">
        <div class="rate-content">
          OMG,太好看了，太好用了，我的天阿！OMG,太好看了，太好用了，我的天阿！OMG,太好看了，太好用了，我的天阿！
        </div>
        <!-- 布尔值控制显示和隐藏 -->
        <div class="rate-with-img">
          <img src="../../assets/images/steel.png" alt="">
          <img src="../../assets/images/steel.png" alt="">
          <img src="../../assets/images/steel.png" alt="">
        </div>

        <div class="time">2019-06-20</div>
        <div class="goods-detail">
          <img src="../../assets/images/steel.png" alt="">
          <div class="goods-info">
            <div class="goods-name">钢管</div>
            <div class="goods-mark">
              <div class="mark-info">
                <span>标 号：</span>外16内6.03<span />
              </div>
              <div class="mark-info">
                <span>标 号：</span>外18内6.03<span />
              </div>
              <div class="mark-info">
                <span>标 号：</span>外20内6.03<span />
              </div>
            </div>
            <div class="goods-price">299.00元/吨</div>
          </div>
        </div>
      </div>
    </div>
    <el-pagination
      background
      layout="prev, pager, next"
      :page-sizes="[2, 5, 10, 20]"
      :page-size="pageSize"
      :total="1000"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
    />
  </div>
</template>
<script>
export default {
  name: 'MyRate',
  data() {
    return {
      tabs: ['全部评价(120)', '有图(20)'],
      currentIndex: 0,
      pageSize: 5,
      pageIndex: 1
    }
  },
  methods: {
    handleClick(index) {
      this.currentIndex = index
    },
    // 页个数数改变的时候可获取当前显示个数
    handleSizeChange(size) {
      console.log(size)
      this.pageSize = size
      // this.loadPost();个数改变的时候再次调用请求
    },
    // 页数改变的时候可获取当前显示当前页码数
    handleCurrentChange(currentPage) {
      console.log(currentPage)
      this.pageIndex = currentPage
      // this.loadPost();页码数改变的时候再次调用请求
    }
  }
}
</script>
>
<style scoped lang="scss">
.el-pagination{
  height: 130px;
  display: flex;
  justify-content: center;
  align-items: center;
  // margin-top: 20px;
  background-color: #fff;
}
::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active {
    background-color: #fff;
    color: #FF3B30FF;
    border: 1px solid #FF3B30FF;
}

::v-deep .el-pagination.is-background .el-pager li:not(.disabled){
// background-color: #fff;
border: 1px solid #DDDDDDFF;
}
::v-deep .el-pagination.is-background .btn-prev{
border: 1px solid #DDDDDDFF;
padding: 0 15px;
}
::v-deep .el-icon-arrow-left:before {
    content: "上一页";
}
::v-deep .el-pagination.is-background .btn-next{
border: 1px solid #DDDDDDFF;
padding: 0 15px;
}
::v-deep .el-icon-arrow-right:before {
    content: "下一页";
}
// 、、、、、
.header-container {
  height: 57px;
  background-color: #fff;
  padding: 18px 20px 18px 30px;
  display: flex;
  // justify-content: space-between;
  align-items: center;
  // margin-bottom: 20px;
  h1 {
    font-weight: 700;
    font-size: 16px;
  }
  .tab-container {
    display: flex;
    height: 57px;
    justify-content: center;
    align-items: center;
    margin-left: 20px;
    color: #3d3d3d;
    .tab-item {
      padding: 0 27px;
      height: 57px;
      line-height: 57px;
    }
    .tab-item:hover {
      cursor: pointer;
    }
    .tab-item.active {
      border-bottom: 3px solid #ff3b30;
      color: #ff3b30;
    }
  }
}
.middle-container{
  height: 20px;
  background-color: #f7f7f7;
}
.main-container {
  padding: 15px 20px 0 20px;
  background-color: #fff;
  .rate-item {
    border-bottom: 1px dashed #e5e5e5;
    margin-bottom: 18px;
    .rate-content {
      color: #6b6b6b;
      margin-bottom: 9px;
    }
    .rate-with-img {
      margin-top: 3px;
      margin-bottom: 12px;
      display: flex;
      img {
        width: 67px;
        height: 67px;
        object-fit: cover;
        margin-right: 10px;
      }
    }
    .time {
      color: #c7c7cc;
      font-size: 12px;
    }
    .goods-detail {
      background-color: #fbfbfb;
      padding: 15px;
      margin: 17px 0 20px 0;
      display: flex;
      img {
        width: 58px;
        height: 58px;
        object-fit: cover;
        margin-right: 16px;
      }
      .goods-info {
        .goods-name {
          color: #3d3d3d;
        }
        .goods-mark {
          display: flex;
          font-size: 10px;
          margin-bottom: 5px;
          .mark-info {
            span:nth-child(1) {
              color: #a7a7aa;
            }
            span:nth-child(2) {
              color: #8d8d8d;
            }
          }
          div.mark-info:nth-child(2) {
            margin: 0 10px;
          }
        }
        .goods-price {
          font-size: 12px;
          color: #ff3b30;
        }
      }
    }
  }
  .rate-item:last-child {
    border: none;
     margin-bottom: 0px;
    .goods-detail{
       margin-bottom: 0px;
    }
  }
}
</style>
